# ~*~ coding: utf-8 ~*~
import os
from apps.config import APP_DIR, PROJECT_DIR
from datetime import timedelta

SECRET_KEY = '78954258242'
APP_DIR = APP_DIR
PROJECT_DIR = PROJECT_DIR
# Session
PERMANENT_SESSION_LIFETIME = timedelta(minutes=30)
# flask-login cookie过期时间
REMEMBER_COOKIE_DURATION = timedelta(minutes=30)

# 日志
LOG_PATH = os.path.join(PROJECT_DIR, 'logs')
LOG_FILE_MAX_BYTES = 100 * 1024 * 1024

# 媒体文件访问路径
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'data')

# 临时文件访问路径
TEMP_DIR = os.path.join(PROJECT_DIR, 'temp')

SQL_FILE_DIR = os.path.join(PROJECT_DIR, 'data', 'sql')

# db models
DB_MODELS_IMPORTS = (
    'apps.users', 'apps.perms', 'apps.ops', 'apps.assets',
    'apps.terminal', 'apps.codes', 'apps.tasks'
)
# celery task
CELERY_TASKS_IMPORTS = ('apps.ops', 'apps.assets', 'apps.terminal', 'apps.tasks')

# # 需要执行任务的配置
# BEAT_TASK_LIST = [
#     {'task-ops-add-test-8-8': dict(task='apps.ops.tasks.add', schedule=600, args=(8, 8))},
# ]

# terminal
RECORDS_LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'records')
SFTP_ROOT = '/home'

# codes
CODE_BASE = '/tmp/bees/codes'

# tasks
TASKS_BASE = '/tmp/bees/tasks'
TASKS_LOG_DIR = os.path.join(PROJECT_DIR, 'data', 'tasks')
ROLES_FILE_DIR = os.path.join(PROJECT_DIR, 'data', 'roles')

# opt
OTP_VALID_WINDOW = 2
OTP_ISSUER_NAME = 'bees'
SECURITY_MFA_AUTH = False
